Fixes for raymarine, netstumbler, skyforce.
authorrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 1 Jan 2014 05:46:19 +0000 (05:46 +0000)
committerrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 1 Jan 2014 05:46:19 +0000 (05:46 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4695 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/netstumbler.cc
gpsbabel/raymarine.cc
gpsbabel/skyforce.cc

index 83e06a1e71b1b50a35fbc6dc09af2106db9ee0d1..d9e43deed1216da8824e728af2c3ab82bfcadc6e 100644 (file)
@@ -231,13 +231,13 @@ data_read(void)
 
     if (snmac) {
       snprintf(desc, sizeof desc, "%s/%d Mbps/Ch %d", ssid, speed, channel);
-      wpt_tmp->shortname = xstrdup(mac);
+      wpt_tmp->shortname = (mac);
     } else {
       snprintf(desc, sizeof desc, "%d Mbps/Ch %d/%s", speed, channel, mac);
-      wpt_tmp->shortname = xstrdup(ssid);
+      wpt_tmp->shortname = (ssid);
     }
 
-    wpt_tmp->description = xstrdup(desc);
+    wpt_tmp->description = desc;
     wpt_tmp->longitude = lon;
     wpt_tmp->latitude = lat;
     wpt_tmp->SetCreationTime(mktime(&tm));
@@ -326,14 +326,7 @@ fix_netstumbler_dupes(void)
 
   for (i = 0, bh = htable; i < ct; i++, bh++) {
     if (last_crc == bh->crc) {
-#if NEW_STRINGS
       bh->wpt->shortname += QString("/%1").arg(++serial);
-#else
-      char ssid[32 + 5 + 1];
-      snprintf(ssid, sizeof ssid, "%s/%d", CSTRc(bh->wpt->shortname), ++serial);
-      xfree(bh->wpt->shortname);
-      bh->wpt->shortname = xstrdup(ssid);
-#endif
     } else {
       last_crc = bh->crc;
     }
index a44f4403c55b553618f60e35654e754d8e40e9e8..b3a1fa6e5a63dd9c0f42f22da283db1705d1f890 100644 (file)
@@ -208,14 +208,14 @@ raymarine_read(void)
     }
 
     wpt = waypt_new();
-    wpt->shortname = xstrdup(name);
+    wpt->shortname = name;
     wpt->latitude = atof(lat);
     wpt->longitude = atof(lon);
     waypt_add(wpt);
 
     /* try to read optional values */
     if (((str = inifile_readstr(fin, sect, "Notes"))) && *str) {
-      wpt->notes = xstrdup(str);
+      wpt->notes = str;
     }
     if (((str = inifile_readstr(fin, sect, "Time"))) && *str) {
       wpt->SetCreationTime(EXCEL_TO_TIMET(atof(str)));
@@ -244,7 +244,7 @@ raymarine_read(void)
     }
 
     rte = route_head_alloc();
-    rte->rte_name = xstrdup(name);
+    rte->rte_name = name;
     route_add_head(rte);
 
     for (wx = 0; wx < 0x3FFF; wx++) {
index 6c53b7cbb813b6cd7cb98febe0904cfd63390419..1ac4a039a012e875581e3792ce60686733889bef 100644 (file)
@@ -78,7 +78,10 @@ skyforce_parse_wpt(const char* str, int* rte_num)
     return NULL;
   }
 
-  wpt->shortname = lrtrim(xstrndup(str + 10, 9));
+  // The line has fixed columns and starts like:
+  // R 001 029 BEARHILL  N42...
+  // Grab "BEARHILL" and whack trailing space.
+  wpt->shortname = QString(str).mid(10,9).trimmed();
 
   if (rte_num) {
     *rte_num = atoi(str + 2);